const fs = require('fs')
const path = require('path')
const ejs = require('ejs')

const fn = (tmp, dest, data) => {
  ejs.renderFile(path.join(tmp, 'package.json'), data, (err, res) => {
    if (err) throw err
    fs.writeFileSync(path.join(dest, 'package.json'), res)
  })
}

module.exports = fn